package com.neusoft.neuiotms.dcom.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@org.hibernate.annotations.Table(appliesTo = "neuiot_functional_user", comment = "职能分组人员表")
@Table(name = "neuiot_functional_user")
public class FunctionalUser extends AbstractModel {

    private static final long serialVersionUID = 1L;

    /** 人员名称 */
    @NotBlank(message = "人员名称不能为空")
    @Length(max = 255, message = "人员名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '人员名称'")
    private String name;

    /** 人员编码 */
    @NotBlank(message = "人员编码不能为空")
    @Length(max = 255, message = "人员编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '人员编码'")
    private String code;

    /** 关联职能组 */
    @ManyToOne
    FunctionalGroup group;
}
